BuffEffect101 = BaseBuffEffect:new();
BuffEffect101.__index = BuffEffect101;

function BuffEffect101:new()
    local object = {};
    setmetatable(object, BuffEffect101);
    return object;
end

function BuffEffect101:action(fight,buff,...)
    local result = select('3',...);
    local target = select('1',...);
    local skill = select('2',...);
    local skillBean = skill.skill.skillBean;
    local buffvalue = decodeJsonStrToTabel(buff.buffBean.f_Value);

    if skillBean.f_TriggerFigthHurt == EnumConst.SkillDamageTypeEnum.HEAL then
        return EnumConst.IBuffEffect.SUCCESS;
    end

    fightLog("[EFFECT]Fighter "..buff.target.fighterId.." Buff"..buff.modelId.." 触发攻击减伤BUFF效果");
    local damage = Mathf.Floor(result.damage * (EnumConst.TEN_THOUSANDTH - buffvalue[1])/EnumConst.TEN_THOUSANDTH);
    
    fightLog("[DAMAGE]"..buff.target.fighterId.."对"..target.fighterId.."计算BUFF("..buff.modelId..")攻击减伤伤害[4]结果"..subDigitalNum(damage,4));
    result.damage = damage;
    return EnumConst.IBuffEffect.SUCCESS;
end
